{extend name='public/layout' /}

{block name="assign"}
{assign name="page_title" value="控制台" /}
{/block}

{block name='body'}
<div class="layui-row layui-col-space15">

	<div class="layui-col-sm6 layui-col-md4">
		<div class="layui-card">
			<div class="layui-card-header">文档</div>
			<div class="layui-card-body">
				<div class="layadmin-backlog">
					<ul class="layui-row layui-col-space10 layui-this">
						<li class="layui-col-xs6">
							<a href="{:url('article/index')}" class="layadmin-backlog-body">
								<h3>总数量</h3>
								<p><cite>{$article_count}</cite></p>
							</a>
						</li>
						<li class="layui-col-xs6">
							<a href="{:url('article/index','status=0')}" class="layadmin-backlog-body">
								<h3>待审帖子</h3>
								<p><cite>{$article_audited_count}</cite></p>
							</a>
						</li>
					</ul>
				</div>
			</div>
		</div>
	</div>
	<div class="layui-col-sm6 layui-col-md4">
		<div class="layui-card">
			<div class="layui-card-header">
				访问量
				<span class="layui-badge layui-bg-blue layuiadmin-badge">周</span>
			</div>
			<div class="layui-card-body">
				<div class="layadmin-backlog">
					<ul class="layui-row layui-col-space10 layui-this">
						<li class="layui-col-xs4">
							<div class="layadmin-backlog-body">
								<h3>支付宝</h3>
								<p><cite>{$to_week_alipay_pv_count}</cite></p>
							</div>
						</li>
						<li class="layui-col-xs4">
							<div class="layadmin-backlog-body">
								<h3>微信</h3>
								<p><cite>{$to_week_wechat_pv_count}</cite></p>
							</div>
						</li>
						<li class="layui-col-xs4">
							<div class="layadmin-backlog-body">
								<h3>总计访问量</h3>
								<p><cite>{$to_week_alipay_pv_count+$to_week_wechat_pv_count}</cite></p>
							</div>
						</li>
					</ul>
				</div>
			</div>
		</div>
	</div>
	<div class="layui-col-sm6 layui-col-md4">
		<div class="layui-card">
			<div class="layui-card-header">
				活跃用户
				<span class="layui-badge layui-bg-orange layuiadmin-badge">月</span>
			</div>
			<div class="layui-card-body">
				<div class="layadmin-backlog">
					<ul class="layui-row layui-col-space10 layui-this">
						<li class="layui-col-xs4">
							<div class="layadmin-backlog-body">
								<h3>支付宝</h3>
								<p><cite>{$to_month_alipay_uv_count}</cite></p>
							</div>
						</li>
						<li class="layui-col-xs4">
							<div class="layadmin-backlog-body">
								<h3>微信</h3>
								<p><cite>{$to_month_wechat_uv_count}</cite></p>
							</div>
						</li>
						<li class="layui-col-xs4">
							<div class="layadmin-backlog-body">
								<h3>总计访问量</h3>
								<p><cite>{$to_month_alipay_uv_count+$to_month_wechat_uv_count}</cite></p>
							</div>
						</li>
					</ul>
				</div>
			</div>
		</div>
	</div>

	<div class="layui-col-sm12">
		<div class="layui-card">
			<div class="layui-card-header">
				今日访问量
				<div class="layui-btn-group layuiadmin-btn-group">
					<button class="layui-btn layui-btn-primary layui-btn-xs">昨天</button>
					<button class="layui-btn layui-btn-primary layui-btn-xs">今天</button>
				</div>
			</div>
			<div class="layui-card-body">
				<div class="layui-row">
					<div class="layui-col-sm8">
						<div class="layadmin-dataview" lay-filter="LAY-index-pagetwo" id="LAY-index-pagetwo">
							<i class="layui-icon layui-icon-loading-1 layui-anim layui-anim-rotate layui-anim-loop layadmin-loading"></i>
						</div>
					</div>
					<div class="layui-col-sm4">
						<div class="layuiadmin-card-list">
							<p class="layuiadmin-normal-font">支付宝周访问数</p>
							<span>同上期增长</span>
							<div class="layui-progress layui-progress-big" lay-showPercent="yes">
								<div class="layui-progress-bar" lay-percent="30%"></div>
							</div>
						</div>
						<div class="layuiadmin-card-list">
							<p class="layuiadmin-normal-font">微信周访问数</p>
							<span>同上期增长</span>
							<div class="layui-progress layui-progress-big" lay-showPercent="yes">
								<div class="layui-progress-bar" lay-percent="20%"></div>
							</div>
						</div>
						<div class="layuiadmin-card-list">
							<p class="layuiadmin-normal-font">总周访问量</p>
							<span>同上期增长</span>
							<div class="layui-progress layui-progress-big" lay-showPercent="yes">
								<div class="layui-progress-bar" lay-percent="25%"></div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<div class="layui-col-sm5">
		<div class="layui-card">
			<div class="layui-card-header">本周活跃用户列表</div>
			<div class="layui-card-body">
				<table class="layui-table layuiadmin-page-table" lay-skin="line">
					<thead>
					<tr>
						<th>用户名</th>
						<th>最后登录时间</th>
						<th>最后登录IP</th>
						<th>积分</th>
					</tr>
					</thead>
					<tbody>
					{volist name='to_week_uv_list' id='vo'}
					<tr>
						<td>
							<span class="{$i==1?'first':''}{$i==2?'second':''}{$i==3?'third':''}">{$vo.nickName}</span>
							<span style="font-size: 10px;color: gray">({$vo.origin_text})</span>
						</td>
						<td>
							{$vo.last_login_time|date='Y-m-d H:i'}
						</td>
						<td>
							<p style="font-size: 10px;color: gray">{$vo.last_login_ip}</p>
							<p>{$vo.last_login_ip_addr}</p>
						</td>
						<td>{$vo.energy} <i class="layui-icon layui-icon-rate"></i></td>
					</tr>
					{/volist}
					</tbody>
				</table>
			</div>
		</div>
	</div>
	<div class="layui-col-sm7">
		<div class="layui-card">
			<div class="layui-card-header">用户全国分布</div>
			<div class="layui-card-body">
				<div class="layui-row layui-col-space15">
					<div class="layui-col-sm4">
						<table class="layui-table layuiadmin-page-table" lay-skin="line">
							<thead>
							<tr>
								<th>排名</th>
								<th>地区</th>
								<th>人数</th>
							</tr>
							</thead>
							<tbody>
							<tr>
								<td>1</td>
								<td>浙江</td>
								<td>62310</td>
							</tr>
							<tr>
								<td>2</td>
								<td>上海</td>
								<td>59190</td>
							</tr>
							<tr>
								<td>3</td>
								<td>广东</td>
								<td>55891</td>
							</tr>
							<tr>
								<td>4</td>
								<td>北京</td>
								<td>51919</td>
							</tr>
							<tr>
								<td>5</td>
								<td>山东</td>
								<td>39231</td>
							</tr>
							<tr>
								<td>6</td>
								<td>湖北</td>
								<td>37109</td>
							</tr>
							</tbody>
						</table>
					</div>
					<div class="layui-col-sm8">
						<div class="layadmin-dataview" lay-filter="LAY-index-pagethree" id="LAY-index-pagethree">
							<i class="layui-icon layui-icon-loading-1 layui-anim layui-anim-rotate layui-anim-loop layadmin-loading"></i>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

</div>
{/block}

{block name='foot'}
<script>
layui.use(['echarts'], function() {
	console.log(layui.echarts);
	var e = layui.$
		, a = (layui.carousel,
		layui.echarts)
		, l = []
		, t = [{
		tooltip: {
			trigger: "axis"
		},
		calculable: !0,
		legend: {
			data: ["访问量", "下载量", "平均访问量"]
		},
		xAxis: [{
			type: "category",
			data: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"]
		}],
		yAxis: [{
			type: "value",
			name: "访问量",
			axisLabel: {
				formatter: "{value} 万"
			}
		}, {
			type: "value",
			name: "下载量",
			axisLabel: {
				formatter: "{value} 万"
			}
		}],
		series: [{
			name: "访问量",
			type: "line",
			data: [900, 850, 950, 1e3, 1100, 1050, 1e3, 1150, 1250, 1370, 1250, 1100]
		}, {
			name: "下载量",
			type: "line",
			yAxisIndex: 1,
			data: [850, 850, 800, 950, 1e3, 950, 950, 1150, 1100, 1240, 1e3, 950]
		}, {
			name: "平均访问量",
			type: "line",
			data: [870, 850, 850, 950, 1050, 1e3, 980, 1150, 1e3, 1300, 1150, 1e3]
		}]
	}]
		, i = e("#LAY-index-pagetwo")
		, n = function(e) {
		l[e] = a.init(i[e], layui.echartsTheme),
			l[e].setOption(t[e]),
			window.onresize = l[e].resize
	};
	i[0] && n(0)
})

layui.use(["echarts"], function() {
	var e = layui.$
		, a = (layui.carousel,
		layui.echarts)
		, l = []
		, t = [{
		title: {
			text: "全国的 layui 用户分布",
			subtext: "不完全统计"
		},
		tooltip: {
			trigger: "item"
		},
		dataRange: {
			orient: "horizontal",
			min: 0,
			max: 6e4,
			text: ["高", "低"],
			splitNumber: 0
		},
		series: [{
			name: "全国用户分布",
			type: "map",
			mapType: "china",
			selectedMode: "multiple",
			itemStyle: {
				normal: {
					label: {
						show: !0
					}
				},
				emphasis: {
					label: {
						show: !0
					}
				}
			},
			data: [{
				name: "西藏",
				value: 60
			}, {
				name: "青海",
				value: 167
			}, {
				name: "宁夏",
				value: 210
			}, {
				name: "海南",
				value: 252
			}, {
				name: "甘肃",
				value: 502
			}, {
				name: "贵州",
				value: 570
			}, {
				name: "新疆",
				value: 661
			}, {
				name: "云南",
				value: 8890
			}, {
				name: "重庆",
				value: 10010
			}, {
				name: "吉林",
				value: 5056
			}, {
				name: "山西",
				value: 2123
			}, {
				name: "天津",
				value: 9130
			}, {
				name: "江西",
				value: 10170
			}, {
				name: "广西",
				value: 6172
			}, {
				name: "陕西",
				value: 9251
			}, {
				name: "黑龙江",
				value: 5125
			}, {
				name: "内蒙古",
				value: 1435
			}, {
				name: "安徽",
				value: 9530
			}, {
				name: "北京",
				value: 51919
			}, {
				name: "福建",
				value: 3756
			}, {
				name: "上海",
				value: 59190
			}, {
				name: "湖北",
				value: 37109
			}, {
				name: "湖南",
				value: 8966
			}, {
				name: "四川",
				value: 31020
			}, {
				name: "辽宁",
				value: 7222
			}, {
				name: "河北",
				value: 3451
			}, {
				name: "河南",
				value: 9693
			}, {
				name: "浙江",
				value: 62310
			}, {
				name: "山东",
				value: 39231
			}, {
				name: "江苏",
				value: 35911
			}, {
				name: "广东",
				value: 55891
			}]
		}]
	}]
		, i = e("#LAY-index-pagethree")
		, n = function(e) {
		l[e] = a.init(i[e], layui.echartsTheme),
			l[e].setOption(t[e]),
			window.onresize = l[e].resize
	};
	i[0] && n(0)
})
</script>
{/block}
